From d7345c440f19f2d71d75303e683ac9e83b0052e8 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Wed, 2 Nov 2005 00:08:01 +0100 Subject: [PATCH] Changeset 7419 introduced a check for DOM0 before setting a bit in the cpu_present map. This prevents domU SMP kernels without HOTPLUG_CPU support from booting. Secondary cpus need to be present and online before init/main.c:do_basic_setup() calls init_workqueues() (which initializes per-cpu workqueues). Without this patch, non HOTPLUG_CPU enabled kernels hang when flushing cpu workqueues as the spinlock in the structure is never initialized (it has a default value of zero which means the lock has been acquired on x86). Signed-off-by: Ryan Harper Signed-off-by: Keir Fraser --- linux-2.6-xen-sparse/arch/xen/kernel/smpboot.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/linux-2.6-xen-sparse/arch/xen/kernel/smpboot.c b/linux-2.6-xen-sparse/arch/xen/kernel/smpboot.c index 6e15afb008..be1384679d 100644 --- a/linux-2.6-xen-sparse/arch/xen/kernel/smpboot.c +++ b/linux-2.6-xen-sparse/arch/xen/kernel/smpboot.c @@ -236,8 +236,12 @@ void __init smp_prepare_cpus(unsigned int max_cpus) make_page_readonly((void *)cpu_gdt_descr[cpu].address); cpu_set(cpu, cpu_possible_map); +#ifdef CONFIG_HOTPLUG_CPU if (xen_start_info->flags & SIF_INITDOMAIN) cpu_set(cpu, cpu_present_map); +#else + cpu_set(cpu, cpu_present_map); +#endif vcpu_prepare(cpu); } @@ -265,6 +269,8 @@ void __devinit smp_prepare_boot_cpu(void) cpu_online_map = cpumask_of_cpu(0); } +#ifdef CONFIG_HOTPLUG_CPU + static void vcpu_hotplug(unsigned int cpu) { int err; @@ -284,11 +290,7 @@ static void vcpu_hotplug(unsigned int cpu) cpu_set(cpu, cpu_present_map); (void)cpu_up(cpu); } else if (strcmp(state, "offline") == 0) { -#ifdef CONFIG_HOTPLUG_CPU (void)cpu_down(cpu); -#else - printk(KERN_INFO "Ignoring CPU%d hotplug request\n", cpu); -#endif } else { printk(KERN_ERR "XENBUS: unknown state(%s) on CPU%d\n", state, cpu); @@ -338,8 +340,6 @@ static int __init setup_vcpu_hotplug_event(void) subsys_initcall(setup_vcpu_hotplug_event); -#ifdef CONFIG_HOTPLUG_CPU - int __cpu_disable(void) { cpumask_t map = cpu_online_map; -- 2.30.2